﻿using System;
using Cassandra;

namespace dreamwork.cassandratest.app
{
    class Program
    {
        static void Main(string[] args)
        {
            var cluster = Cluster.Builder()
                     .AddContactPoints("127.0.0.1")
                     .Build();
            // Connect to the nodes using a keyspace
            var session = cluster.Connect("demodb");
            // Execute a query on a connection synchronously
            var rs = session.Execute("SELECT * FROM emp");
            // Iterate through the RowSet
            foreach (var row in rs)
            {
                var value = row.GetValue<int>("empid");
                // Do something with the value
            Console.WriteLine(value);
            }
            Console.ReadLine();
        }
    }
}
